package cn.com.nes.site.controller.workOrder;

import cn.com.nes.common.web.CommonResult;
import cn.com.nes.site.entity.vo.workOrder.GetWorkOrderStatisticalVO;
import cn.com.nes.site.service.workOrder.WorkOrderStatisticService;
import cn.com.nes.site.service.workOrder.bo.GetWorkOrderStatisticalBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 工单统计控制层
 *
 * @Author: ShenWei
 * @Date: 2024/09/04/11:03
 */
@Api(tags = {"项目模块 - 安装工单管理 - 统计"})
@Controller
@RequestMapping("/v2/order/work/statistic")
public class WorkOrderStatisticController {

    @Resource
    private WorkOrderStatisticService workOrderStatisticService;

    @ApiOperation("查询统计结果")
    @RequestMapping(value = "/getWorkOrderStatisticalResult", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<?> distributeWorkOrderInstall(GetWorkOrderStatisticalVO vo) throws Exception {
        return CommonResult.data(workOrderStatisticService.getWorkOrderStatisticalResult(vo.convertToBo()));
    }




}
